<!-- 告警详情 -->

<template>
  <EasyModal v-model="model" v-bind="MAP.MODEL_PROPS">
    <WebShow class="DetailAlarm">
      <AlarmBase />
      <AlarmDeal />
    </WebShow>

    <DealModal />

    <template #footer>
      <AlarmFooter />
    </template>
  </EasyModal>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import store from './store'
import mixDetail from '@admin/components/detail/mixDetail'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'DetailAlarm',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixStore(store), mixDetail],

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(require.context('./', true, /vue$/)),

  /**
   * 创建完成 (先抽取再调用)
   */
  created() {
    const user = CORE.USER
    const organ = CORE.ORGAN.MAP[user.organId[0]] || {}

    CORE.merge(this.deal_INIT_ONE, {
      dealUserId: user.uaaUserId,
      dealUserName: user.name,
      dealUserPhone: user.phone,
    })

    CORE.merge(this.add_INIT_ONE, {
      orderSourceCode: 'task_alarm', // 工单来源：告警转派
      step: 2, // 不需要第一步的提单人和模板选择
      releaseUserId: user.uaaUserId,
      releaseUserName: user.name,
      releaseUserPhone: user.phone,
      organizationId: organ.id || '',
      organizationName: organ.name || '',
      organizationAreaId: organ.regionId || '',
      organizationAreaName: organ.regionName || '',
    })
  },
}
</script>
